package com.itheima;

import com.itheima.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App2 {
    public static void main(String[] args) {
        // 3. 获取IoC容器
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

        // 4. 获取bean
//        BookDao bookdao = (BookDao) context.getBean("bookdao");
//        bookdao.save();

        BookService bookService = (BookService) context.getBean("bookService");
        bookService.save();
    }
}
